package demo.spring.aop.test;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

/**
 * Created by lushun.chen on 2017/3/26.
 *
 * @author lushun.chen
 */
@Aspect
public class TimeHandler implements MethodBeforeAdvice{

    @Pointcut("execution(* demo.spring.aop.test.*.* (..))")// the pointcut expression
    public void printTime() {
        System.out.println("CurrentTime = " + System.currentTimeMillis());
    }

    @Override
    public void before(Method method, Object[] objects, Object o) throws Throwable {
        System.out.println(123456789);
    }
}
